package php4dvdPages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

/**
 * @author Anna Alexeyenko
 *         Date: 1/28/13
 */
public class MoviePage extends InternalPage {

    @FindBy(xpath = "//section/nav//a[contains(@href, \"&own=\")]")
    private WebElement ownButton;

    @FindBy(xpath = "//section/nav//a[contains(@href, \"&seen=\")]")
    private WebElement seenButton;

    @FindBy(xpath = "//div[@id=\"movie\"]//h2")
    private WebElement movieTitleAndYear;

    @Override
    public boolean isOnThisPage() {
        return ownButton.isDisplayed() && seenButton.isDisplayed();
    }

    public WebElement getMovieTitleAndYear() {
        return movieTitleAndYear;
    }


}
